package top.kaoshanji.p3ch12a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.List;

/**
 * 代码清单-p3ch12a-391页a：方法覆写是否生效的测试代码
 * author kaoshanji
 * ^_^
 * create time 2025/2/6 16:45
 */
public class OverrideTest {

    private static final Logger logger = LogManager.getLogger(OverrideTest.class);

    public static void main(String[] args) {
        logger.info("...代码清单-p3ch12a-391页a：方法覆写是否生效的测试代码...");

        SubClass subClass = new SubClass();
        subClass.method(null);

    }


}

class SuperClass {

    public void method(List<?> param) {
        System.out.println("我是父类SuperClass中的方法");
    }

}

class SubClass extends SuperClass {

    @Override
    public void method(List param) {
        System.out.println("我是子类SubClass中的方法");
    }
}

